   <script>
  $(document).ready(function() {
    $("#date_created").datepicker();
    $('#preview').lightBox();
  });
  </script>

<h1 class="center grid_11 aligncenter">Edit Image Details</h1>
<div class="center grid_11 error" >
<?php 
	echo validation_errors();
?>
</div>
<?php 
if( !empty($uploaderrors)){ foreach ($uploaderrors as $error )  {?>
<p class='error' >
	<?php echo $error?>
</p>
<?php } }?>
<?php
$attributes = array('class' => '', 'id' => 'imageuploadform');
$hidden = array('submitted' => true );
echo form_open($submitpath, $attributes,$hidden); ?>
<div class="grid_3 nicebutton aligncenter">
<a href="<?php  echo $previewpath;?>" id="preview" >
<?php echo $imgs?></a>
<input type="submit" class="alignright margin_top20" name="delete" id="delete" value="delete" />
</div>

<div class="grid_4 nicebutton">
	<div class="grid_2 aligncenter" >Title <span class="req">*</span></div>
	<div class="grid_3" >
	<input type="text" size="25" class="niceform" id="title" name="title" <?php if( getError( $errors,'title') )echo 'class="error"';?> value="<?php echo set_value('title',$imagequery->title); ?>"/>  
	</div>
	
	<div class="grid_2 clearleft aligncenter" >Description</div>
	<div class="grid_3" >
	<textarea class="niceform" cols="25" id="description" name="description" ><?php echo set_value('description',$imagequery->description); ?></textarea>
	</div>
	<div class="grid_2 clearleft aligncenter " >Short Description</div>
	<div class="grid_2 clearleft" >
	<textarea class="niceform " cols="25" id="short_description" name="short_description"  ><?php echo set_value('short_description',$imagequery->short_desc); ?></textarea>
	</div>
</div>

<div class="grid_4 nicebutton">
	<div class="grid_2 clearleft aligncenter" >Category</div>
	<div class="grid_2 clearleft" >
	<?php 
	$additional = 'class="niceform"';
	echo form_dropdown('categories', $options, $catid,$additional);
	?>
	</div>
	<div class="grid_2 clearleft aligncenter niceform" >New Category</div>
	<div class="grid_2 clearleft" >
	<input type="text" class="niceform" name="new_cat" size="15" value="<?php echo set_value('new_cat'); ?>"/>
	</div>
	<div class="grid_2 clearleft aligncenter" >Price</div> 
	<div class="grid_2 clearleft" >
	<input type="text" class="niceform" name="price" size="15" <?php if( getError( $errors,'price') )echo 'class="error"';?> value="<?php echo set_value('price',0); ?>"/>
	</div>
</div>

<div class="grid_11 alignright nicebutton" >
<input type="submit" name="cancel" class="margin_right20" id="cancel"  value="Cancel" />
<input type="submit" value="Update" />
</div>
 
</form>